﻿using System.Collections.Generic;

namespace Miao.ML
{
	public abstract class GenericReferenceObjectData : ReferenceObjectData, IGeneric, IQualifiedName
	{
		internal readonly List<IGeneric> genericArgumentList = new List<IGeneric>();

		public virtual bool isGenericType => genericArgumentList.Count > 0;

		public int genericArgumentCount => genericArgumentList.Count;

		public string openTypeName { get; set; }

		public IEnumerable<IGeneric> genericArguments => genericArgumentList;

		public IGeneric GetGenericArgument(int index)
		{
			return genericArgumentList[index];
		}

		public void AddGenericArgument(IGeneric generic)
		{
			genericArgumentList.Add(generic);
		}
	}
}
